package com.tstudy.laoshibang.share;
//package com.xw.kdb.share;
//
//import org.apache.http.Header;
//
//import com.google.gson.Gson;
//import com.loopj.android.http.BaseJsonHttpResponseHandler;
//import com.loopj.android.http.ResponseHandlerInterface;
//import com.xw.kdb.R;
//import com.xw.kdb.base.BaseFragment.BaseJsonHandler;
//import com.xw.kdb.base.KdbApplication;
//import com.xw.kdb.mode.response.UserResponse;
//import com.xw.kdb.utils.CommonUtil;
//import com.xw.kdb.utils.LogUtil;
//
//public class LoginManager {
//	
//	private LoginManager() {
//	}
//	private static LoginManager instance = new LoginManager();
//	private Gson mGson = new Gson();
//	public static LoginManager getInstance(){
//		return instance;
//	}
//	
//	 public abstract class BaseListJsonHandler<T> extends BaseJsonHttpResponseHandler<T> {
//	        @Override
//	        public void onSuccess(int statusCode, Header[] headers, String rawJsonResponse, T response) {
//	            LogUtil.d(rawJsonResponse);
//	        }
//
//	        @Override
//	        public void onFailure(int statusCode, Header[] headers, Throwable throwable, String rawJsonData, T errorResponse) {
//	        	KdbApplication.showToast(statusCode + throwable.getMessage());
//	        	KdbApplication.showToast(R.string.json_format_error);
//	        }
//
//	        @Override
//	        public void onStart() {
//	            super.onStart();
//	            LogUtil.d("onStart showloading::" + this);
//	        }
//	       
//	    }
//	
//	public void login(int source,String sourceId,String nick,int sex,String avatarUrl,final LoginCallBack callBack){
//		ResponseHandlerInterface response = new BaseJsonHandler<UserResponse>() {
//			@Override
//			public void onStart() {
//				// TODO Auto-generated method stub
//				super.onStart();
//			}
//			@Override
//			public void onSuccess(int statusCode, Header[] headers,
//					String rawJsonResponse, UserResponse response) {
//				super.onSuccess(statusCode, headers, rawJsonResponse, response);
//				if (CommonUtil.responseSuccess(response)) {
//					if (response.getData() != null) {
//						String userNo =response.getData().getUserNo();
//		             }
//				}else {
//                    KdbApplication.showToast(response.getErrMsg());
//                }
//			}
//			@Override
//			public UserResponse parseResponse(String rawJsonData, boolean isFailure)
//					throws Throwable {
//				return mGson.fromJson(rawJsonData,UserResponse.class);
//			}
//			
//		};
//	}
//	public interface LoginCallBack{
//		public void onSuccess(boolean isWeiboLogin);
//		public void onFailed(String errorMsg);
//		public void onAuthComplete(boolean result);
//	}
//	
//}
